<script>
  init({
    title: 'filterBy',
    desc: '(Can use only in client-side) Filter data in table, <br />' +
      'e.g. You can filter <code>{age: 10}</code> to show the data only age is equal to 10. <br />' +
      'You can also filter with an array of values, as in: <code>{age: 10, hairColor: ["blue", "red", "green"]}</code> to find data where age is equal to 10 and hairColor is either blue, red, or green.<br />' +
      'In this example, we filter by: <code>$table.bootstrapTable(\'filterBy\', {id: [1, 2, 3]})</code>',
    links: ['bootstrap-table.min.css'],
    scripts: ['bootstrap-table.min.js']
  })
</script>

<div id="toolbar">
  <button id="button" class="btn btn-secondary">filterBy</button>
</div>
<table
  id="table"
  data-toggle="table"
  data-toolbar="#toolbar"
  data-height="400"
  data-url="json/data1.json">
  <thead>
    <tr>
      <th data-field="id">ID</th>
      <th data-field="name">Item Name</th>
      <th data-field="price">Item Price</th>
    </tr>
  </thead>
</table>

<script>
  var $table = $('#table')
  var $button = $('#button')

  function mounted() {
    $button.click(function () {
      $table.bootstrapTable('filterBy', {
        id: [1, 2, 3]
      })
    })
  }
</script>
